home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / contrib / zelk / scm / countlines.e < prev    next >
Encoding:
Text File  |  1992-10-17  |  215 b   |  9 lines

  1. ;; countlines.e - return the # of lines in a file
  2. (require 'shell.e)
  3.  
  4. (define (countlines file)
  5.   (let ((s (open-input-string (car (getoutput (string-append "wc " file))))))
  6.     (read s)
  7.     (close-input-port s))
  8. )
  9.